package com.android.nextBus.Activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

public class ReturnFromPaymentActivity extends Activity //implements OnClickListener 
{
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.return_from_payment_layout);
		
		Bundle extras = getIntent().getExtras(); 
		String message = null;
		
		int status = -1;
		if (extras != null) {
			message = extras.getString("message");
			status = extras.getInt("status");
		}
		
		TextView headerView = (TextView) findViewById(R.id.return_header);
		TextView messageView = (TextView) findViewById(R.id.return_message);
		
		switch (status) {
		case 0: headerView.setText("Payment Succeeded");
		break;
		case 1: headerView.setText("Payment Canceled");
		break;
		case 2: headerView.setText("Payment Failed");
		}
		
		messageView.setText(message);
	}

	public void okButtonOnClick(View v) {
		Intent intent = new Intent(this, MainMenuActivity.class);
		startActivity(intent);
	}
}

